<%@page import="java.util.Map"%>
<%@page import="java.util.List"%>
<%@ page language="java" pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>转账</title>    
    <link rel="stylesheet" href="${pageContext.request.contextPath}/static/css/wallet/zhuanzhang.css?v=1.4" />
</head>
<body>
<form action="${pageContext.request.contextPath}/admin/payQrcode_pay.action" method="post" id="form">
	<input type="hidden" name="sid" value="${sid}" >
	<div class="box">
<%-- 		<div class="top">
			<h3>
				<div><img src="${pageContext.request.contextPath}/static/images/admin/wallet/arrow.png" alt="" /></div>
				<span>转账</span>
			</h3>
		</div> --%>
		<div class="user">向<span>“${cname }”</span>转账</div>
		<div class="state">
			<p class="h">转账金额</p>
			<p class="sec"><label style="font-size:1.2rem;">￥</label><input type="number" class="number" id='amount' name="amount" /></p>
			<p class="third">
				<input placeholder="添加备注（40字以内）"  name="memo"/>
			</p>
		</div>
		<div class="botton">
			<input type="button" name="" id="btn" class="" onclick="pay()" value="确认转账" />
		</div>
	</div>
</form>
</body>
</html>
<script src="${pageContext.request.contextPath}/static/js/jquery-1.11.3.min.js"></script>
<script src="${pageContext.request.contextPath}/static/plugins/layer_mobile/layer.js"></script>

<script>
var sid='${sid}';
  $(".state .number").keyup(function(){
		var input=$(".state .number");
		if(input.val()!=''){
			$("#btn").addClass("active");
		}else{
			$("#btn").removeClass("active");
		}
  });
  $(".state .number").focus();
  if(!checkUserAgent()){
	 showMsg("请使用支付宝app打开");
  }
  
  function pay(){
	  if(!checkUserAgent()){
		  showMsg("请使用支付宝app打开");
		  return;
	  }
	  var amount = $("#amount").val();
	  if(amount==''){
		  showMsg("请输入转账金额");
		  return;
	  }
	$("#form").submit();  
  }
  
  function checkUserAgent(){
	  
	  var userAgentInfo = navigator.userAgent;
	  if(userAgentInfo.indexOf("AlipayClient")>-1){
		  return true;
	  }else{
		  return false;			  
	  }
  }
  
  function showMsg(content){
		layer.open({
		    content:content,
		    time:2
		});
	}
</script>